//---------------------------------------------------------------------------
#ifndef uParmPrtH
#define uParmPrtH
//---------------------------------------------------------------------------
#include <Classes.hpp>
#include <Controls.hpp>
#include <StdCtrls.hpp>
#include <Forms.hpp>
#include <ExtCtrls.hpp>
#include "CForm.h"
#include "Eic.h"
#include "BTrieve.h"
//---------------------------------------------------------------------------
static AnsiString strWinNTKeyPorts( "Software\\Microsoft\\Windows NT\\CurrentVersion\\Ports");
//---------------------------------------------------------------------------
typedef struct {
  char  szModele[31];    // Nom de l'imprimante
  char  szPort  [26];    // Port utilisé
  char  cCodeLanguage;   // Code langage imrpimante (0=inconnu / 1=PCL5)
  short sLignes;         // Nombre de ligne du papier
  short sColonnes;       // Nombre de cractères de la ligne

  short sSkipPage;       // TRUE/FALSE=Saut par page/ligne
  char  szCI[18][77];    // Chaines d'initialisation
  char  szStartFile[37]; //
  char  szEndFile  [37]; // 
} TDefPrinter;
//---------------------------------------------------------------------------
#define IDX_INIT          0
#define IDX_REINIT        1
#define IDX_INIT_COURIER  2
#define IDX_GRAS_DEB      3
#define IDX_GRAS_FIN      4
#define IDX_SOUL_DEB      5
#define IDX_SOUL_FIN      6
#define IDX_ITALIK_DEB    7
#define IDX_ITALIK_FIN    8
#define IDX_10CPI         9
#define IDX_12CPI        10
#define IDX_166CPI       11
#define IDX_20CPI        12
#define IDX_6LPI         13
#define IDX_8LPI         14
#define IDX_PORTRAIT     15
#define IDX_PAYSAGE      16
#define IDX_TERMINE      17
//---------------------------------------------------------------------------
void __fastcall ExtractConstructeurPrinter( const AnsiString &strModele, AnsiString &strConstructeur, AnsiString &strPrinter);
void __fastcall ParametrerImprimante( CBtrvFile *pBtrv, const AnsiString &strConstructeur, const AnsiString &strImprimante);
//---------------------------------------------------------------------------
class TfrmParamPrinter : public CForm
{
__published:	// Composants gérés par l'EDI
    TPanel *Panel1;
    TLabel *Label1;
    TLabel *Label2;
    TLabel *lblConstructeur;
    TLabel *lblImprimante;
    TPanel *Panel2;
    TButton *btnAnnuler;
    TButton *btnOk;
    TPanel *Panel3;
    TEdit *edNbLines;
    TEdit *edNbCols;
    TEdit *edInit;
    TEdit *edReinit;
    TEdit *edInitCourier;
    TLabel *Label3;
    TLabel *Label4;
    TLabel *Label5;
    TLabel *Label6;
    TLabel *Label7;
    TEdit *edGrasFin;
    TEdit *edGrasDeb;
    TEdit *edItalikFin;
    TEdit *edItalikDeb;
    TEdit *edSoulFin;
    TEdit *edSoulDeb;
    TLabel *Label8;
    TLabel *Label9;
    TLabel *Label10;
    TLabel *Label11;
    TLabel *Label12;
    TLabel *Label13;
    TLabel *Label14;
    TLabel *Label15;
    TLabel *Label16;
    TEdit *ed10CPI;
    TEdit *ed12CPI;
    TEdit *ed166CPI;
    TEdit *ed20CPI;
    TEdit *ed6LPI;
    TEdit *ed8LPI;
    TLabel *Label17;
    TLabel *Label18;
    TLabel *Label19;
    TLabel *Label20;
    TLabel *Label21;
    TLabel *Label22;
    TEdit *edPortrait;
    TEdit *edPaysage;
    TLabel *Label23;
    TLabel *Label24;
    TCheckBox *cbPageSkip;
    void __fastcall FormCloseQuery(TObject *Sender, bool &CanClose);
private:	// Déclarations de l'utilisateur
    CBtrvFile *m_pBtrv;
    virtual void __fastcall DoDataExchange( CDataExchange* pdx);
public:		// Déclarations de l'utilisateur
    __fastcall TfrmParamPrinter( CBtrvFile *pBtrv,
                                 const AnsiString &strConstruc,
                                 const AnsiString &strImprim,
                                 TComponent* Owner = NULL);
};
//---------------------------------------------------------------------------
#endif
